package com.book.common;

/**
 * @version 1.0
 * @Author Jincheng.Li
 * @Date 2021/5/18 10:50 上午
 * @Project_Name graduation-project
 */
public enum BookStatusEnum {
    BOOK_STATUS_YES(1, "在售"),
    BOOK_STATUS_NO(0, "已卖出");

    private Integer code;
    private String msg;

    BookStatusEnum (Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMsg(Integer code) {
        BookStatusEnum [] payTypeEnums = values();
        for (BookStatusEnum p : payTypeEnums
        ) {
            if (p.code.equals(code)) {
                return p.msg;
            }
        }
        return null;
    }

    public static Integer getCode(String msg){
        return 0;
    }
}
